<?php
$id=intval($_GET['id']);
$cat=blog_get_category_of_item($id);
$cache=new cache;
	
	$og_url=HOME."blog/c$id/".$cat['main']['alias']."/";
	//-------------------------- GET LIST BAI VIET CATEGORY ----------------
    $sql ="SELECT id,name,alias,upload_user,upload_time,post,view,subcategory from blog_post where category=$id and status=1 order by id desc ";
	$sql2="SELECT id from blog_post where  category=$id and status=1";

	$pager = new Pagination($sql, 20, 5,$og_url,0,"blog_get_user");
	$pager->setDebug(false);
	$cache=new cache;
	$data[info] = $pager->paginate($cache,$sql2);
	$data[nav]	= $pager->renderFullNav();
	

	
	
	

			$data1[title]=web_title($cat['main']['seo_title']);
			$data1['mota']=web_des($cat['main']['seo_description']);
			$data1['keyword']=web_keyword($cat['main']['seo_keyword']);
$data['category']=$cat;			

loadview('template/header_blog',$data1);
loadview("blog/category",$data);
loadview('template/footer_blog');
exit();